import 'package:flutter/material.dart';
import 'package:aweb5/base/BaseWidget.dart';
import 'package:aweb5/pages/PaySucceed.dart';
class GotoPay extends BaseWidget {
  @override
  State<GotoPay> createState() => GotoPayState();
}

class GotoPayState extends BaseWidgetState<GotoPay> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    init(context);
    return Scaffold(
      backgroundColor: Color(0xffffffff),
        appBar: appBarWithBack("立即支付"),
       body: Column(
         crossAxisAlignment: CrossAxisAlignment.start,
         children: <Widget>[
           select(),
           SizedBox(height: 10,),
           Divider(height: 1,color: Color(0xffe9e9e9),),
           payitem()
         ],
       ),
      bottomSheet: Container(
        height: 49.0,
        // padding: EdgeInsets.only(left: 10.0, right: 10.0),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Expanded(
                flex: 2,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: <Widget>[
                    SizedBox(width: 10),
                    Text(
                      "总计",
                      style: TextStyle(
                          color: Color(0xff2d2d2d),
                          fontSize: 14,
                          fontWeight: FontWeight.bold),
                    ),
                    Text(
                      "¥9",
                      style: TextStyle(color: Color(0xffff0000), fontSize: 18),
                    )
                  ],
                )),
            Expanded(
              flex: 2,
              child:
              InkWell(
                child: Container(
                height: 49,
                decoration: BoxDecoration(color: Color(0xffff8900)),
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    Text(
                      "确认支付",
                      style: TextStyle(
                        color: Colors.white,
                        fontSize: 16.0,
                      ),
                    ),
                  ],
                ),
              ),
              onTap: (){
                navigatorState.push(new MaterialPageRoute(builder: (con){return new PaySucceed();}));
              },
              ),
            ),
          ],
        ),
      ),
    );
  }
  Widget select(){
    return Container(
      margin: EdgeInsets.only(left: 10,top: 15),
      child: Text("选择支付",style: TextStyle(color:Color(0xff2d2d2d),fontSize: 14),),
    );
  }
  Widget payitem(){
    return ListView(
      shrinkWrap: true,
      children: <Widget>[
        Container(
          margin: EdgeInsets.only(left: 10,right: 10,top: 10),
          child: Row(
            children: <Widget>[
              Image.asset("assets/wixinzhifu.png",width: 23,height: 23,),
              SizedBox(width: 12,),
              Text("微信支付",style: TextStyle(color: Color(0xff2d2d2d),fontSize: 14),),
              Expanded(child: Text("")),
              Image.asset("assets/check.png",width: 20,height: 16,)
            ],
          ),
          
        )
      ],
    );
  }
  
}